#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>


int main()
{
  pid_t id=fork();
  if(id==0)
  {
    //child
    //int cnt=5;
    while(1)
    {
    printf("I am child,pid:%d\n",getpid());
    sleep(1);
   }
  }
  else
  {
    int n=5;
    //parent
    while(n--)
    {
      printf("I am parent,running always,pid:%d\n",getpid());
      sleep(1);
    }
  }
  return 0;
}
